package stool.mementopattern;

/**
 * @Author Felix YF Dong
 * @Date 2021/5/9
 */
public class Main {

    public static void main(String[] args) {

        Originator o = new Originator();
        o.setState("1");
        o.show();

        Caretaker c = new Caretaker();
        c.setMemento(o.createMemento(o.getState()));

        o.setState("0");
        o.show();

        o.setMemento(c.getMemento());
        o.show();
    }
}
